﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="sennightOrderEdit.aspx.cs"
    ValidateRequest="false" Inherits="PeisongWeb.admin.sennightOrderEdit" %>

<%@ Register TagName="top" Src="controls/top.ascx" TagPrefix="uc1" %>
<%@ Register TagName="menu" Src="controls/menu.ascx" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>自由报价订单管理 - 想购网采购配送系统</title>
    <!--#include file="style.inc"-->

    <script src="/app_common/scripts/jquery-1.3.2.min.js" type="text/javascript"></script>

    <script src="/app_common/scripts/json-minified.js" type="text/javascript"></script>

    <script src="/app_common/scripts/javascript.serialize.js" type="text/javascript"></script>

    <script src="/app_common/scripts/javascript-float-plus.js" type="text/javascript"></script>
    
    <script src="/app_common/scripts/JSLib.js?1.0" type="text/javascript"></script>
    <script src="/app_common/scripts/KeyMapFilter.js" type="text/javascript"></script>
    <script src="scripts/sennightOrder.js?7.1" type="text/javascript"></script>

</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="sm1" runat="server">
    </asp:ScriptManager>
    <ext:ScriptManager ID="ScriptManager1" runat="server" />
    <uc1:top ID="Top1" runat="server" />
    <uc2:menu ID="Menu1" runat="server" />
    <div id="admin_main" style="margin: 10px 0 0 10px;">
        <ext:Panel ID="Panel2" runat="server" Title="添加自由报价订单" BodyStyle="padding:5px 5px 0"
            Width="650" Frame="true" ButtonAlign="Center">
            <Body>
                <asp:UpdatePanel runat="server" ID="UpdatePanel2" UpdateMode="Conditional">
                    <Triggers>
                        <asp:PostBackTrigger ControlID="lbn_AddProduct" />                 
                        <asp:PostBackTrigger ControlID="btn_Save" />
                    </Triggers>
                    <ContentTemplate>
                        <div id="admin_edit_content">
                            <ul>
                                <li>
                                    <label>
                                        公司名称：</label>
                                    <asp:DropDownList runat="server" ID="drp_company" DataTextField="company" DataValueField="companyId"
                                        AutoPostBack="true" OnSelectedIndexChanged="drp_company_SelectedIndexChanged">
                                    </asp:DropDownList>
                                    <span id="val_company" style="color: Red; display: none;">请选择公司名称</span> </li>
                                <li>
                                    <label>
                                        联系人姓名：</label>
                                    <asp:Label runat="server" ID="lbl_contact"></asp:Label>
                                </li>
                                <li>
                                    <label>
                                        联系方式：</label>
                                    <asp:Label runat="server" ID="lbl_contactMobile"></asp:Label>
                                    <asp:Label runat="server" ID="lbl_contactPhone"></asp:Label>
                                </li>
                                <li>
                                    <label>
                                        收货地址：</label>
                                    <asp:Label runat="server" ID="lbl_Address"></asp:Label>
                                </li>
                                <li>
                                    <label>
                                        税 费：</label>
                                    <input runat="server" id="txt_taxfee" name="txt_taxfee" type="text" value="0.00" />
                                    <span id="val_taxfee" style="color: Red; display: none">请输入税费，如果没有税费为：0.00</span>
                                </li>
                                <li>
                                    <label>
                                        运费：</label>
                                    <input runat="server" id="txt_fireightFee" name="txt_fireightFee" type="text" value="0.00" />
                                    <span id="val_fireightFee" style="color: Red; display: none">请输入税费，如果没有运费为：0.00</span>
                                </li>
                            </ul>
                            <p>
                                &nbsp;</p>
                            <table width="98%" border="0" cellpadding="4" cellspacing="1">
                                <tr>
                                    <td>
                                        <h2 style="float: left; margin-right: 20px">
                                            商品信息
                                        </h2>
                                        <asp:LinkButton runat="server" ID="lbn_AddProduct" Text="添加商品" OnClick="lbn_AddProduct_Click"
                                            OnClientClick="return chkCompany()"></asp:LinkButton>
                                        <span id="val_proScope" style="color: Red; display: none; margin-left: 20px">未选择商品，不能提交订单，请选择商品！</span>
                                        <hr />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <div id="admin_edit_content_infor" style="width: 630px">
                                            <span id="span_selectPros">
                                                <table width="98%">
                                                    <tr align="center" style="height: 20px;">
                                                        <td width="5%" bgcolor="#C0D5F0">
                                                            序号
                                                        </td>
                                                        <td width="25%" bgcolor="#C0D5F0">
                                                            商品名称
                                                        </td>
                                                        <td width="10%" bgcolor="#C0D5F0">
                                                            供应价
                                                        </td>
                                                        <td width="10%" bgcolor="#C0D5F0">
                                                            商品价格
                                                        </td>
                                                        <td width="5%" bgcolor="#C0D5F0">
                                                            商品数量
                                                        </td>
                                                        <td width="30%" bgcolor="#C0D5F0">
                                                            备注信息
                                                        </td>
                                                        <td width="8%" bgcolor="#C0D5F0">
                                                            合计
                                                        </td>
                                                        <td width="15%" bgcolor="#C0D5F0">
                                                            删除
                                                        </td>
                                                    </tr>
                                                    <tbody id="tableBody">
                                                    </tbody>
                                                    <tr align="center" style="height: 20px;">
                                                        <td bgcolor="#C0D5F0">
                                                            <a href="javascript:void(0)" onclick="updateTableRow();">刷新</a>
                                                        </td>
                                                        <td bgcolor="#C0D5F0" colspan="5">
                                                            合&nbsp;&nbsp;计
                                                        </td>
                                                        <td bgcolor="#FFFFFF" align="right">
                                                            <span class="red" id="span_proSum"></span>
                                                        </td>
                                                        <td bgcolor="#FFFFFF">
                                                        </td>
                                                    </tr>
                                                </table>
                                            </span><span style="margin-left: 150px; margin-top: 10px">
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <p>
                                &nbsp;</p>
                            <ul>
                                <li>
                                    <label>
                                        订单总价：</label>
                                    <asp:Label runat="server" ID="lbl_StandardAmount"></asp:Label>
                                </li>
                                <li>
                                    <label>
                                        支付总价：</label>
                                    <input runat="server" id="txt_Amount" name="" type="text" readonly="readonly" style="background-color: #f0f0f0" />
                                    <span id="val_Amount" style="color: Red; display: none">请填写支付总价</span> </li>
                                <li>
                                    <label>
                                        收货时间：</label>
                                    <span style="float: left">
                                        <%-- <ext:DateField ID="ext_receiveDt" runat="server" AllowBlank="true" ReadOnly="true" />--%>
                                        <%=DateTime.Now.AddDays(1).ToShortDateString() %>
                                    </span>
                                    <asp:DropDownList runat="server" ID="ddl_receiveTime">
                                        <asp:ListItem Value="7">7:00</asp:ListItem>
                                        <asp:ListItem Value="8">8:00</asp:ListItem>
                                        <asp:ListItem Value="9">9:00</asp:ListItem>
                                        <asp:ListItem Value="10">10:00</asp:ListItem>
                                        <asp:ListItem Value="11">11:00</asp:ListItem>
                                        <asp:ListItem Value="12">12:00</asp:ListItem>
                                        <asp:ListItem Value="13">13:00</asp:ListItem>
                                        <asp:ListItem Value="14">14:00</asp:ListItem>
                                        <asp:ListItem Value="15">15:00</asp:ListItem>
                                        <asp:ListItem Value="16">16:00</asp:ListItem>
                                        <asp:ListItem Value="17">17:00</asp:ListItem>
                                        <asp:ListItem Value="18">18:00</asp:ListItem>
                                        <asp:ListItem Value="19">19:00</asp:ListItem>
                                    </asp:DropDownList>
                                </li>
                                <li>
                                    <label>
                                        客户备注：</label>
                                    <asp:TextBox runat="server" ID="txt_Note" Rows="3" Columns="20" TextMode="MultiLine"
                                        Text="" MaxLength="500"></asp:TextBox>
                                </li>
                                <li>
                                    <label>
                                        &nbsp;</label>
                                    <asp:Button runat="server" ID="btn_Save" Text="保　存" OnClick="btn_Save_Click" OnClientClick="return chkFm()" />
                                    <input type="button" id="btn_Return" value="返　回" onclick="window.location.href='sennightOrderList.aspx'" />
                                    <input id="hd_proScope" runat="server" value="" type="hidden" />
                                    <input id="hd_TotalAmount" runat="server" value="0.00" type="hidden" />
                                </li>
                            </ul>
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </Body>
        </ext:Panel>
        <ext:Window ID="win_product" runat="server" Title="添加商品" Height="630px" Width="1120px"
            BodyStyle="padding: 6px; background-color: #fff;" AutoScroll="true" Modal="true"
            Resizable="false" ShowOnLoad="false" Draggable="false" Icon="ApplicationViewDetail">
            <Body>
                <asp:UpdatePanel runat="server" ID="up1" UpdateMode="Conditional">
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="ddl_CategoryRoot" />
                        <asp:AsyncPostBackTrigger ControlID="ddl_CategorySub" />
                        <asp:AsyncPostBackTrigger ControlID="lbn_search" />
                    </Triggers>
                    <ContentTemplate>
                        <div class="details">
                            <table width="100%" border="0" cellpadding="4" cellspacing="1" style="text-align: left">
                                <tr>
                                    <td style="width: 18%">
                                        <label>
                                            大 类：</label>
                                        <asp:DropDownList runat="server" ID="ddl_CategoryRoot" DataTextField="name" DataValueField="categoryId"
                                            AutoPostBack="True" OnSelectedIndexChanged="ddl_CategoryRoot_SelectedIndexChanged">
                                        </asp:DropDownList>
                                    </td>
                                    <td style="width: 18%">
                                        <label>
                                            小 类：</label>
                                        <asp:DropDownList runat="server" ID="ddl_CategorySub" DataTextField="name" 
                                            DataValueField="categoryId" AutoPostBack="True" 
                                            onselectedindexchanged="ddl_CategorySub_SelectedIndexChanged">
                                        </asp:DropDownList>
                                    </td>
                                    <td style="width: 18%">
                                        商品编号:<asp:TextBox ID="txt_ProductNo" runat="server" Width="80px"></asp:TextBox>
                                    </td>
                                    <td style="width: 18%">
                                        商品名称:<asp:TextBox ID="txt_ProductName" runat="server" Width="80px"></asp:TextBox>
                                    </td>
                                    <td style="width: 16%">
                                        <asp:LinkButton ID="lbn_search" runat="server" Text="［搜索］" CausesValidation="false"
                                            OnClick="lbn_search_Click">
                                        </asp:LinkButton>
                                        <a href="javascript:resetSrh();">［重置］</a>
                                    </td>
                                </tr>
                            </table>
                            <table id="tb_pro" width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#99BBE8"
                                style="text-align: left">
                                <tr align="center" style="height: 20px; background-color: #C0D5F0">
                                    <td width="7%">
                                        商品编号
                                    </td>
                                    <td width="20%">
                                        商品名称
                                    </td>
                                    <td width="14%">
                                        供应价(￥)
                                    </td>
                                    <td width="8%">
                                        卖出价
                                    </td>
                                    <td width="8%">
                                        数量
                                    </td>
                                    <td width="20%">
                                        添加备注
                                    </td>
                                    <td width="15%">
                                        供应商
                                    </td>
                                    <td width="8%">
                                        操作
                                    </td>
                                </tr>
                                <asp:Repeater runat="server" ID="rpt_Products" OnItemDataBound="rpt_Products_ItemDataBound"
                                    EnableViewState="false">
                                    <ItemTemplate>
                                        <tr align="center" class='<%# Container.ItemIndex%2==0? "row-altv2":"altv2"  %>'
                                            onmouseover="c=this.style.backgroundColor;this.style.backgroundColor='#C0D5F0'"
                                            onmouseout="this.style.backgroundColor=c">
                                            <td>
                                                <%# Eval("productNo")%>
                                            </td>
                                            <td>
                                                <a target="_blank" href="../user_productDetail_<%#Eval("productId")%>.html">
                                                    <%# Eval("Name")%></a>
                                            </td>
                                            <td>
                                                <input type="text" class="text_price_align" onblur='checkCountNum2(this);' onafterpaste='checkCountNum2(this);'
                                                    value="1" />/<%#Eval("unit")%>
                                            </td>
                                            <td>
                                                <input class="text_price_align" onblur='checkCountNum2(this);' onafterpaste='checkCountNum2(this);'
                                                    value="1" />
                                            </td>
                                            <td align="center">
                                                <input type="text" class="text_price_align" onblur='checkCountNum2(this);' onafterpaste='checkCountNum2(this);'
                                                    value="1" maxlength="8" />
                                            </td>
                                            <td align="center">
                                                <input type="text" maxlength="200" style="width: 150px" />
                                            </td>
                                            <td>
                                                <asp:DropDownList runat="server" ID="ddl" DataTextField="companyName" DataValueField="companyId"
                                                    Width="205px">
                                                </asp:DropDownList>
                                            </td>
                                            <td align="center">
                                                <input type="button" value="添加" onclick="return addToOrderItem(this,<%#Eval("productId") %>,'<%#Eval("unit") %>');" />
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </table>
                            <div>
                                <webdiyer:AspNetPager ID="AspNetPager2" NumericButtonType="Text" MoreButtonType="Text"
                                    runat="server" AlwaysShow="False" PageSize="20" InvalidPageIndexErrorMessage="无效页码"
                                    PageIndexOutOfRangeErrorMessage="页码超出范围" ShowCustomInfoSection="Left" CustomInfoHTML=" 每页%PageSize%条记录 | 总共%RecordCount%条记录 "
                                    CustomInfoTextAlign="Left" HorizontalAlign="Right" OnPageChanged="AspNetPager2_PageChanged"
                                    NextPageText="下一页" FirstPageText="首页" LastPageText="末页" PrevPageText="上一页">
                                </webdiyer:AspNetPager>
                            </div>
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </Body>
        </ext:Window>
    </div>
    <cb:Include ID="adminOrderEdit" runat="server" SetName="adminOrderEdit" />
    </form>
</body>
</html>
